const sqlite3 = require('sqlite3').verbose();
const db = new sqlite3.Database('chat.db');
db.serialize(()=>{
  db.run(`CREATE TABLE IF NOT EXISTS messages (
            id INTEGER PRIMARY KEY AUTOINCREMENT,
            username TEXT,
            content TEXT,
            ts DATETIME DEFAULT CURRENT_TIMESTAMP
          )`);
});
db.close();
console.log('✅ 数据库初始化完成');